import java.util.Scanner;

public class Main4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum = 0;
        for (int i = 0; i < m; i++) {
            sum += in.nextInt();
        }
        System.out.println(sum - n * (m - 1) > 0 ? sum - n * (m - 1) : 0);
    }
}
